3.4.10 \(\int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx\) [310]

3.4.10.1 Optimal result
3.4.10.2 Mathematica [B] (warning: unable to verify)
3.4.10.3 Rubi [A] (verified)
3.4.10.4 Maple [B] (verified)
3.4.10.5 Fricas [F(-2)]
3.4.10.6 Sympy [F(-1)]
3.4.10.7 Maxima [B] (verification not implemented)
3.4.10.8 Giac [F]
3.4.10.9 Mupad [F(-1)]

3.4.10.1 Optimal result

Integrand size = 22, antiderivative size = 399 \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\frac {2 i d (c+d x)^3}{b^2}+\frac {(c+d x)^4}{2 b}-\frac {2 (c+d x)^4 \text {arctanh}\left (e^{2 i (a+b x)}\right )}{b}-\frac {6 d^2 (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b^3}+\frac {6 i d^3 (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^4}+\frac {2 i d (c+d x)^3 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^2}-\frac {2 i d (c+d x)^3 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}-\frac {3 d^4 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{b^5}-\frac {3 d^2 (c+d x)^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{b^3}+\frac {3 d^2 (c+d x)^2 \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{b^3}-\frac {3 i d^3 (c+d x) \operatorname {PolyLog}\left (4,-e^{2 i (a+b x)}\right )}{b^4}+\frac {3 i d^3 (c+d x) \operatorname {PolyLog}\left (4,e^{2 i (a+b x)}\right )}{b^4}+\frac {3 d^4 \operatorname {PolyLog}\left (5,-e^{2 i (a+b x)}\right )}{2 b^5}-\frac {3 d^4 \operatorname {PolyLog}\left (5,e^{2 i (a+b x)}\right )}{2 b^5}-\frac {2 d (c+d x)^3 \tan (a+b x)}{b^2}+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b} \]

output
2*I*d*(d*x+c)^3*polylog(2,-exp(2*I*(b*x+a)))/b^2+1/2*(d*x+c)^4/b-2*(d*x+c) 
^4*arctanh(exp(2*I*(b*x+a)))/b-6*d^2*(d*x+c)^2*ln(1+exp(2*I*(b*x+a)))/b^3- 
2*I*d*(d*x+c)^3*polylog(2,exp(2*I*(b*x+a)))/b^2+6*I*d^3*(d*x+c)*polylog(2, 
-exp(2*I*(b*x+a)))/b^4-3*I*d^3*(d*x+c)*polylog(4,-exp(2*I*(b*x+a)))/b^4-3* 
d^4*polylog(3,-exp(2*I*(b*x+a)))/b^5-3*d^2*(d*x+c)^2*polylog(3,-exp(2*I*(b 
*x+a)))/b^3+3*d^2*(d*x+c)^2*polylog(3,exp(2*I*(b*x+a)))/b^3+2*I*d*(d*x+c)^ 
3/b^2+3*I*d^3*(d*x+c)*polylog(4,exp(2*I*(b*x+a)))/b^4+3/2*d^4*polylog(5,-e 
xp(2*I*(b*x+a)))/b^5-3/2*d^4*polylog(5,exp(2*I*(b*x+a)))/b^5-2*d*(d*x+c)^3 
*tan(b*x+a)/b^2+1/2*(d*x+c)^4*tan(b*x+a)^2/b
 
3.4.10.2 Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(2227\) vs. \(2(399)=798\).

Time = 7.65 (sec) , antiderivative size = 2227, normalized size of antiderivative = 5.58 \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\text {Result too large to show} \]

input
Integrate[(c + d*x)^4*Csc[a + b*x]*Sec[a + b*x]^3,x]
 
output
-((c^2*d^2*E^(I*a)*Csc[a]*((2*b^3*x^3)/E^((2*I)*a) + (3*I)*b^2*(1 - E^((-2 
*I)*a))*x^2*Log[1 - E^((-I)*(a + b*x))] + (3*I)*b^2*(1 - E^((-2*I)*a))*x^2 
*Log[1 + E^((-I)*(a + b*x))] - 6*b*(1 - E^((-2*I)*a))*x*PolyLog[2, -E^((-I 
)*(a + b*x))] - 6*b*(1 - E^((-2*I)*a))*x*PolyLog[2, E^((-I)*(a + b*x))] + 
(6*I)*(1 - E^((-2*I)*a))*PolyLog[3, -E^((-I)*(a + b*x))] + (6*I)*(1 - E^(( 
-2*I)*a))*PolyLog[3, E^((-I)*(a + b*x))]))/b^3) - (c*d^3*E^(I*a)*Csc[a]*(( 
b^4*x^4)/E^((2*I)*a) + (2*I)*b^3*(1 - E^((-2*I)*a))*x^3*Log[1 - E^((-I)*(a 
 + b*x))] + (2*I)*b^3*(1 - E^((-2*I)*a))*x^3*Log[1 + E^((-I)*(a + b*x))] - 
 6*b^2*(1 - E^((-2*I)*a))*x^2*PolyLog[2, -E^((-I)*(a + b*x))] - 6*b^2*(1 - 
 E^((-2*I)*a))*x^2*PolyLog[2, E^((-I)*(a + b*x))] + (12*I)*b*(1 - E^((-2*I 
)*a))*x*PolyLog[3, -E^((-I)*(a + b*x))] + (12*I)*b*(1 - E^((-2*I)*a))*x*Po 
lyLog[3, E^((-I)*(a + b*x))] + 12*(1 - E^((-2*I)*a))*PolyLog[4, -E^((-I)*( 
a + b*x))] + 12*(1 - E^((-2*I)*a))*PolyLog[4, E^((-I)*(a + b*x))]))/b^4 - 
(d^4*E^(I*a)*Csc[a]*((2*b^5*x^5)/E^((2*I)*a) + (5*I)*b^4*(1 - E^((-2*I)*a) 
)*x^4*Log[1 - E^((-I)*(a + b*x))] + (5*I)*b^4*(1 - E^((-2*I)*a))*x^4*Log[1 
 + E^((-I)*(a + b*x))] - 20*b^3*(1 - E^((-2*I)*a))*x^3*PolyLog[2, -E^((-I) 
*(a + b*x))] - 20*b^3*(1 - E^((-2*I)*a))*x^3*PolyLog[2, E^((-I)*(a + b*x)) 
] + (60*I)*b^2*(1 - E^((-2*I)*a))*x^2*PolyLog[3, -E^((-I)*(a + b*x))] + (6 
0*I)*b^2*(1 - E^((-2*I)*a))*x^2*PolyLog[3, E^((-I)*(a + b*x))] + 120*b*(1 
- E^((-2*I)*a))*x*PolyLog[4, -E^((-I)*(a + b*x))] + 120*b*(1 - E^((-2*I...
 
3.4.10.3 Rubi [A] (verified)

Time = 1.20 (sec) , antiderivative size = 443, normalized size of antiderivative = 1.11, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4920, 27, 7292, 27, 7293, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx\)

\(\Big \downarrow \) 4920

\(\displaystyle -4 d \int \frac {1}{2} (c+d x)^3 \left (\frac {\tan ^2(a+b x)}{b}+\frac {2 \log (\tan (a+b x))}{b}\right )dx+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

\(\Big \downarrow \) 27

\(\displaystyle -2 d \int (c+d x)^3 \left (\frac {\tan ^2(a+b x)}{b}+\frac {2 \log (\tan (a+b x))}{b}\right )dx+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

\(\Big \downarrow \) 7292

\(\displaystyle -2 d \int \frac {(c+d x)^3 \left (\tan ^2(a+b x)+2 \log (\tan (a+b x))\right )}{b}dx+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {2 d \int (c+d x)^3 \left (\tan ^2(a+b x)+2 \log (\tan (a+b x))\right )dx}{b}+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

\(\Big \downarrow \) 7293

\(\displaystyle -\frac {2 d \int \left (\tan ^2(a+b x) (c+d x)^3+2 \log (\tan (a+b x)) (c+d x)^3\right )dx}{b}+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 d \left (\frac {(c+d x)^4 \text {arctanh}\left (e^{2 i (a+b x)}\right )}{d}+\frac {3 d^3 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^4}-\frac {3 d^3 \operatorname {PolyLog}\left (5,-e^{2 i (a+b x)}\right )}{4 b^4}+\frac {3 d^3 \operatorname {PolyLog}\left (5,e^{2 i (a+b x)}\right )}{4 b^4}-\frac {3 i d^2 (c+d x) \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {3 i d^2 (c+d x) \operatorname {PolyLog}\left (4,-e^{2 i (a+b x)}\right )}{2 b^3}-\frac {3 i d^2 (c+d x) \operatorname {PolyLog}\left (4,e^{2 i (a+b x)}\right )}{2 b^3}+\frac {3 d (c+d x)^2 \operatorname {PolyLog}\left (3,-e^{2 i (a+b x)}\right )}{2 b^2}-\frac {3 d (c+d x)^2 \operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^2}+\frac {3 d (c+d x)^2 \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i (c+d x)^3 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b}+\frac {i (c+d x)^3 \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b}+\frac {(c+d x)^3 \tan (a+b x)}{b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{2 d}-\frac {i (c+d x)^3}{b}-\frac {(c+d x)^4}{4 d}\right )}{b}+\frac {(c+d x)^4 \tan ^2(a+b x)}{2 b}+\frac {(c+d x)^4 \log (\tan (a+b x))}{b}\)

input
Int[(c + d*x)^4*Csc[a + b*x]*Sec[a + b*x]^3,x]
 
output
((c + d*x)^4*Log[Tan[a + b*x]])/b + ((c + d*x)^4*Tan[a + b*x]^2)/(2*b) - ( 
2*d*(((-I)*(c + d*x)^3)/b - (c + d*x)^4/(4*d) + ((c + d*x)^4*ArcTanh[E^((2 
*I)*(a + b*x))])/d + (3*d*(c + d*x)^2*Log[1 + E^((2*I)*(a + b*x))])/b^2 + 
((c + d*x)^4*Log[Tan[a + b*x]])/(2*d) - ((3*I)*d^2*(c + d*x)*PolyLog[2, -E 
^((2*I)*(a + b*x))])/b^3 - (I*(c + d*x)^3*PolyLog[2, -E^((2*I)*(a + b*x))] 
)/b + (I*(c + d*x)^3*PolyLog[2, E^((2*I)*(a + b*x))])/b + (3*d^3*PolyLog[3 
, -E^((2*I)*(a + b*x))])/(2*b^4) + (3*d*(c + d*x)^2*PolyLog[3, -E^((2*I)*( 
a + b*x))])/(2*b^2) - (3*d*(c + d*x)^2*PolyLog[3, E^((2*I)*(a + b*x))])/(2 
*b^2) + (((3*I)/2)*d^2*(c + d*x)*PolyLog[4, -E^((2*I)*(a + b*x))])/b^3 - ( 
((3*I)/2)*d^2*(c + d*x)*PolyLog[4, E^((2*I)*(a + b*x))])/b^3 - (3*d^3*Poly 
Log[5, -E^((2*I)*(a + b*x))])/(4*b^4) + (3*d^3*PolyLog[5, E^((2*I)*(a + b* 
x))])/(4*b^4) + ((c + d*x)^3*Tan[a + b*x])/b))/b
 

3.4.10.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 4920
Int[Csc[(a_.) + (b_.)*(x_)]^(n_.)*((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b 
_.)*(x_)]^(p_.), x_Symbol] :> Module[{u = IntHide[Csc[a + b*x]^n*Sec[a + b* 
x]^p, x]}, Simp[(c + d*x)^m   u, x] - Simp[d*m   Int[(c + d*x)^(m - 1)*u, x 
], x]] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p] && GtQ[m, 0] && NeQ[n, 
p]
 

rule 7292
Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =! 
= u]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
3.4.10.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1728 vs. \(2 (361 ) = 722\).

Time = 1.03 (sec) , antiderivative size = 1729, normalized size of antiderivative = 4.33

method result size
risch \(\text {Expression too large to display}\) \(1729\)

input
int((d*x+c)^4*csc(b*x+a)*sec(b*x+a)^3,x,method=_RETURNVERBOSE)
 
output
2*(b*d^4*x^4*exp(2*I*(b*x+a))+4*b*c*d^3*x^3*exp(2*I*(b*x+a))+6*b*c^2*d^2*x 
^2*exp(2*I*(b*x+a))+4*b*c^3*d*x*exp(2*I*(b*x+a))-2*I*d^4*x^3*exp(2*I*(b*x+ 
a))+b*c^4*exp(2*I*(b*x+a))-6*I*c*d^3*x^2*exp(2*I*(b*x+a))-6*I*c^2*d^2*x*ex 
p(2*I*(b*x+a))-2*I*d^4*x^3-2*I*c^3*d*exp(2*I*(b*x+a))-6*I*c*d^3*x^2-6*I*c^ 
2*d^2*x-2*I*c^3*d)/b^2/(exp(2*I*(b*x+a))+1)^2-3*d^4*polylog(3,-exp(2*I*(b* 
x+a)))/b^5+24*I/b^3*d^3*c*x*a-12*I/b^2*d^3*c*polylog(2,-exp(I*(b*x+a)))*x^ 
2+6*I/b^2*d^3*c*polylog(2,-exp(2*I*(b*x+a)))*x^2-12*I/b^2*d^3*c*polylog(2, 
exp(I*(b*x+a)))*x^2-12*I/b^2*c^2*d^2*polylog(2,-exp(I*(b*x+a)))*x+6*I/b^2* 
c^2*d^2*polylog(2,-exp(2*I*(b*x+a)))*x-12*I/b^2*c^2*d^2*polylog(2,exp(I*(b 
*x+a)))*x-12/b^3*d^3*c*ln(exp(2*I*(b*x+a))+1)*x+4/b*c^3*d*ln(1-exp(I*(b*x+ 
a)))*x+4/b^4*d^3*c*ln(1-exp(I*(b*x+a)))*a^3+12*I/b^4*d^3*c*a^2+6*I/b^4*d^3 
*c*polylog(2,-exp(2*I*(b*x+a)))+2*I/b^2*d^4*polylog(2,-exp(2*I*(b*x+a)))*x 
^3+3/2*d^4*polylog(5,-exp(2*I*(b*x+a)))/b^5-4*I/b^2*c^3*d*polylog(2,exp(I* 
(b*x+a)))+12*I/b^2*d^3*c*x^2+24*I/b^4*d^3*c*polylog(4,-exp(I*(b*x+a)))-3*I 
/b^4*d^3*c*polylog(4,-exp(2*I*(b*x+a)))+24*I/b^4*d^3*c*polylog(4,exp(I*(b* 
x+a)))+6*I/b^4*d^4*polylog(2,-exp(2*I*(b*x+a)))*x-4*I/b^2*d^4*polylog(2,-e 
xp(I*(b*x+a)))*x^3-4*I/b^2*d^4*polylog(2,exp(I*(b*x+a)))*x^3-12*I/b^4*a^2* 
d^4*x+24*I/b^4*d^4*polylog(4,-exp(I*(b*x+a)))*x-3*I/b^4*d^4*polylog(4,-exp 
(2*I*(b*x+a)))*x+24*I/b^4*d^4*polylog(4,exp(I*(b*x+a)))*x-24*d^4*polylog(5 
,-exp(I*(b*x+a)))/b^5-24*d^4*polylog(5,exp(I*(b*x+a)))/b^5-1/b^5*d^4*ln...
 
3.4.10.5 Fricas [F(-2)]

Exception generated. \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\text {Exception raised: TypeError} \]

input
integrate((d*x+c)^4*csc(b*x+a)*sec(b*x+a)^3,x, algorithm="fricas")
 
output
Exception raised: TypeError >>  Error detected within library code:   Too 
many variables
 
3.4.10.6 Sympy [F(-1)]

Timed out. \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\text {Timed out} \]

input
integrate((d*x+c)**4*csc(b*x+a)*sec(b*x+a)**3,x)
 
output
Timed out
 
3.4.10.7 Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 8853 vs. \(2 (352) = 704\).

Time = 4.27 (sec) , antiderivative size = 8853, normalized size of antiderivative = 22.19 \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\text {Too large to display} \]

input
integrate((d*x+c)^4*csc(b*x+a)*sec(b*x+a)^3,x, algorithm="maxima")
 
output
-1/2*(c^4*(1/(sin(b*x + a)^2 - 1) + log(sin(b*x + a)^2 - 1) - log(sin(b*x 
+ a)^2)) - 4*a*c^3*d*(1/(sin(b*x + a)^2 - 1) + log(sin(b*x + a)^2 - 1) - l 
og(sin(b*x + a)^2))/b + 6*a^2*c^2*d^2*(1/(sin(b*x + a)^2 - 1) + log(sin(b* 
x + a)^2 - 1) - log(sin(b*x + a)^2))/b^2 - 4*a^3*c*d^3*(1/(sin(b*x + a)^2 
- 1) + log(sin(b*x + a)^2 - 1) - log(sin(b*x + a)^2))/b^3 + a^4*d^4*(1/(si 
n(b*x + a)^2 - 1) + log(sin(b*x + a)^2 - 1) - log(sin(b*x + a)^2))/b^4 + 2 
*(24*b^3*c^3*d - 72*a*b^2*c^2*d^2 + 72*a^2*b*c*d^3 - 24*a^3*d^4 + 4*(3*(b* 
x + a)^4*d^4 + 9*b^2*c^2*d^2 - 18*a*b*c*d^3 + 9*a^2*d^4 + 8*(b*c*d^3 - a*d 
^4)*(b*x + a)^3 + 9*(b^2*c^2*d^2 - 2*a*b*c*d^3 + (a^2 + 1)*d^4)*(b*x + a)^ 
2 + 6*(b^3*c^3*d - 3*a*b^2*c^2*d^2 + 3*(a^2 + 1)*b*c*d^3 - (a^3 + 3*a)*d^4 
)*(b*x + a) + (3*(b*x + a)^4*d^4 + 9*b^2*c^2*d^2 - 18*a*b*c*d^3 + 9*a^2*d^ 
4 + 8*(b*c*d^3 - a*d^4)*(b*x + a)^3 + 9*(b^2*c^2*d^2 - 2*a*b*c*d^3 + (a^2 
+ 1)*d^4)*(b*x + a)^2 + 6*(b^3*c^3*d - 3*a*b^2*c^2*d^2 + 3*(a^2 + 1)*b*c*d 
^3 - (a^3 + 3*a)*d^4)*(b*x + a))*cos(4*b*x + 4*a) + 2*(3*(b*x + a)^4*d^4 + 
 9*b^2*c^2*d^2 - 18*a*b*c*d^3 + 9*a^2*d^4 + 8*(b*c*d^3 - a*d^4)*(b*x + a)^ 
3 + 9*(b^2*c^2*d^2 - 2*a*b*c*d^3 + (a^2 + 1)*d^4)*(b*x + a)^2 + 6*(b^3*c^3 
*d - 3*a*b^2*c^2*d^2 + 3*(a^2 + 1)*b*c*d^3 - (a^3 + 3*a)*d^4)*(b*x + a))*c 
os(2*b*x + 2*a) - (-3*I*(b*x + a)^4*d^4 - 9*I*b^2*c^2*d^2 + 18*I*a*b*c*d^3 
 - 9*I*a^2*d^4 + 8*(-I*b*c*d^3 + I*a*d^4)*(b*x + a)^3 + 9*(-I*b^2*c^2*d^2 
+ 2*I*a*b*c*d^3 + (-I*a^2 - I)*d^4)*(b*x + a)^2 + 6*(-I*b^3*c^3*d + 3*I...
 
3.4.10.8 Giac [F]

\[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\int { {\left (d x + c\right )}^{4} \csc \left (b x + a\right ) \sec \left (b x + a\right )^{3} \,d x } \]

input
integrate((d*x+c)^4*csc(b*x+a)*sec(b*x+a)^3,x, algorithm="giac")
 
output
integrate((d*x + c)^4*csc(b*x + a)*sec(b*x + a)^3, x)
 
3.4.10.9 Mupad [F(-1)]

Timed out. \[ \int (c+d x)^4 \csc (a+b x) \sec ^3(a+b x) \, dx=\text {Hanged} \]

input
int((c + d*x)^4/(cos(a + b*x)^3*sin(a + b*x)),x)
 
output
\text{Hanged}